Expand description
A small time kit
Project
- Repository: https://bitbucket.org/haibison/dia-time
- License: Nice License 1.0.1 (see LICENSE file at root directory of main branch)
- This project follows Semantic Versioning 2.0.0
Features
- Constants as seconds:
MINUTE
,HOUR
,DAY
,WEEK
. - Constants as milliseconds:
millis::SECOND
,millis::MINUTE
,millis::HOUR
,millis::DAY
,millis::WEEK
. - Other modules:
micros
,nanos
,decis
,centis
,picos
,femtos
,attos
,zeptos
,yoctos
. - And some helper functions for formatting time…
Some components require lib-c
feature. If you can’t access them, you should enable that feature. For example:
[dependencies]
dia-time = { version='...', features=['lib-c'] }
Notes
Documentation is built with all features. Some of them are optional. If you see components from other crates, you can view source to see what features are required.
References
Modules
Some constants in attoseconds
Some constants in centiseconds
Some constants in deciseconds
Some constants in femtoseconds
Some constants in microseconds
Some constants in milliseconds
Some constants in nanoseconds
Some constants in picoseconds
Symbols
6.2.2
(August 8th, 2022)
Some constants in yoctoseconds
Some constants in zeptoseconds
Structs
Enums
Month
Constants
Crate code name
1 day in seconds
1 decasecond
1 exasecond
1 gigasecond
1 hectosecond
1 hour in seconds
ID of this crate
1 kilosecond
1 megasecond
1 minute in seconds
Crate name
1 petasecond
Crate release date (year/month/day)
1 second
Tag, which can be used for logging…
1 terasecond
Crate version
1 week in seconds
1 yottasecond
1 zettasecond
Functions
Converts duration to days, hours, minutes, seconds.
Examples: 9d, 02:53:58
Examples: 3d, 02:53:58.018
Examples: 02:53:58
Examples: 02:53:58.018
If the duration is within a day, forwards to ::format_hms()
; otherwise, forwards to ::format_day_hms()
.
If the duration is within a day, forwards to ::format_hms_ms()
; otherwise, forwards to ::format_day_hms_ms()
.
Tries to convert a duration into local time
Tries to convert a value of Unix seconds into time